package com.gec.service.impl;

import com.gec.dao.UserDao;
import com.gec.dao.impl.UserDaoImpl;
import com.gec.domain.User;
import com.gec.service.UserService;
import com.gec.utils.PageModel;

import java.util.List;

public class UserServiceImpl implements UserService {
    UserDao dao=new UserDaoImpl();
    //添加用户
    @Override
    public void addUser(User user) {
        dao.addUser(user);
    }

    //修改用户
    @Override
    public void updateUser(User user) {
        dao.updateUser(user);
    }

    //删除用户
    @Override
    public void delete(int id) {
        dao.delete(id);
    }

    //查看全部人信息
    @Override
    public List<User> findAllUsers(User users, PageModel model) {
        return dao.findAllUsers(users,model);
    }
    //查询登录时账户密码是否错误
    @Override
    public User login(String loginname, String password) {
        return dao.login(loginname,password);
    }

    //查询个人信息
    @Override
    public User findById(int id) {
        return dao.findById(id);
    }

    @Override
    public int getTotalUserCount(User user) {
        return dao.getTotalUserCount(user);
    }

    @Override
    public User findUserInfo(String loginname) {
        return dao.findUserInfo(loginname);
    }
}
